home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / MSG Demo 1.2 Source / MSG Demo ƒ / Demo code / demo graphics.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-10  |  2.0 KB  |  88 lines  |  [TEXT/KAHL]

  1. /**********************************************************************\
  2.  
  3. File:        demo graphics.c
  4.  
  5. Purpose:    This module handles updating the main window (in the
  6.             offscreen bitmaps).
  7.  
  8.  
  9. MSG Demo -- graphic effects demonstration program
  10. Copyright (C) 1992-3 Mark Pilgrim & Dave Blumenthal
  11.  
  12. This program is free software; you can redistribute it and/or modify
  13. it under the terms of the GNU General Public License as published by
  14. the Free Software Foundation; either version 2 of the License, or
  15. (at your option) any later version.
  16.  
  17. This program is distributed in the hope that it will be useful,
  18. but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. GNU General Public License for more details.
  21.  
  22. You should have received a copy of the GNU General Public License
  23. along with this program in a file named "GNU General Public License".
  24. If not, write to the Free Software Foundation, 675 Mass Ave,
  25. Cambridge, MA 02139, USA.
  26.  
  27. \**********************************************************************/
  28.  
  29. #include "demo graphics.h"
  30. #include "demo.h"
  31.  
  32. void DrawBoardColor(void)
  33. {
  34.     RGBColor    oldForeColor, oldBackColor;
  35.     GrafPtr        curPort;
  36.     
  37.     GetForeColor(&oldForeColor);
  38.     GetBackColor(&oldBackColor);
  39.     
  40.     GetPort(&curPort);
  41.     
  42.     EraseRect(&(curPort->portRect));
  43.     if (!gWhichWipe)
  44.         gWhichPict=!gWhichPict;
  45.     if(gWhichPict)
  46.     {
  47.         HLock(gPict1);
  48.         DrawPicture(gPict1, &(curPort->portRect));
  49.         HUnlock(gPict1);
  50.     }
  51.     else
  52.     {
  53.         HLock(gPict2);
  54.         DrawPicture(gPict2, &(curPort->portRect));
  55.         HUnlock(gPict2);
  56.     }
  57.     if (!gWhichWipe)
  58.         gWhichPict=!gWhichPict;
  59.     
  60.     RGBForeColor(&oldForeColor);
  61.     RGBBackColor(&oldBackColor);
  62. }
  63.  
  64. void DrawBoardBW(void)
  65. {
  66.     GrafPtr    curPort;
  67.     
  68.     GetPort(&curPort);
  69.     
  70.     EraseRect(&(curPort->portRect));
  71.     if (!gWhichWipe)
  72.         gWhichPict=!gWhichPict;
  73.     if(gWhichPict)
  74.     {
  75.         HLock(gPict3);
  76.         DrawPicture(gPict3, &(curPort->portRect));
  77.         HUnlock(gPict3);
  78.     }
  79.     else
  80.     {
  81.         HLock(gPict4);
  82.         DrawPicture(gPict4, &(curPort->portRect));
  83.         HUnlock(gPict4);
  84.     }
  85.     if (!gWhichWipe)
  86.         gWhichPict=!gWhichPict;
  87. }
  88.